#include<stdio.h>

typedef struct student
{
    int ID;
    char name[20];
    int score;
}Student;
Student data[21];

int main(){
    int n,i,cnt=0;
    char bufferc;
    int buf1,buf2,buf3;
    scanf("%d",&n);
    getchar();
    for(i=1;i<=n;i++)
    {
        scanf("%d",&data[i].ID);
        getchar();
        do
        {
            bufferc=getchar();
            data[i].name[cnt]=bufferc;
            cnt++;
        } while (bufferc!=' ');
        data[i].name[cnt-1]='\0';
        cnt=0;
        scanf("%d%d%d",&buf1,&buf2,&buf3);
        data[i].score=(buf1+buf2+buf3)/3;   
    }
    for(i=1;i<=n;i++)
    {
        printf("The average score of the %dth student is %d.\n",i,data[i].score);
    }
    return 0;
}